home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / May 96 / Re Forcing a draw.3 < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.5 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Forcing a draw
  2. Sent:        5/21/96 7:08 AM
  3. Received:    5/22/96 8:32 AM
  4. From:        Henri Lamiraux, lamiraux@apple.com
  5. Reply-To:    ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. >>This easiest way would be to call Invalidate on the view and immediately
  9. >>call Draw. We need to add a ForceRedraw method.
  10. >
  11. >Henri:
  12. >
  13. >I have forced redraw in one my view with the following code, picked from
  14. >somewhere in either ODF or ODF Example code:
  15. >
  16. >void CMyView::UpdateHighlight(Environment* ev, ODShape* selectionShape,
  17. >FW_Boolean redraw)
  18. >{
  19. >        this->Invalidate(ev, selectionShape);
  20. >        if (redraw)
  21. >        {
  22. >                FW_CFrameFacetIterator iter(ev, this->GetFrame(ev));
  23. >                for (ODFacet* facet = iter.First(ev);
  24. >iter.IsNotComplete(ev); facet = iter.Next(ev))
  25. >                        facet->GetWindow(ev)->Update(ev);
  26. >        }
  27. >}
  28. >
  29. >Should I be better replacing the facet->GetWindow(ev)->Update(ev) with a
  30. >call to this->Draw(ev, facet, selectionShape)?
  31. >
  32. >I was not calling Draw directly because I thought doing so will keep a
  33. >pending update event for that window. Is that true?
  34. >
  35. >Serge
  36.  
  37. Serge,
  38.  
  39. For embedding part your are right, this is the right way to force an 
  40. update. Calling FW_CView::Draw is not going to redraw embedded parts 
  41. unless you wrote your part like ODFDraw which doesn't let OpenDoc redraw 
  42. embedded parts but draw them directly along with its intrisinc content.
  43.